<?php
//$img=copy('/part/home2013/451/U601P4T451D1F22436DT20190119111408.jpg');
$dbh=new PDO('mysql:host=localhost;dbname=gaofei','root','root');
$memcache=memcache_connect('127.0.0.1',11211);
//memcache_flush($memcache);
$arr=$memcache->get('a');
if($arr=='')
{
    echo "没有缓存";
    $sql="select * from yuekao";
    $arr=$dbh->query($sql)->fetchAll(PDO::FETCH_ASSOC);
    $memcache->set('a',$arr);
}

?>
<table border="1">
    <tr>
        <td>编号</td>
        <td>链接</td>
        <td>图片地址</td>
        <td>标题</td>
    </tr>
    <?php foreach($arr as $key=>$value) { ?>
        <tr>
            <td><?php echo $value['id']?></td>
            <td><?php echo $value['url']?></td>
            <td><?php echo $value['img_url']?></td>
            <td><?php echo $value['title']?></td>
        </tr>
    <?php } ?>
</table>

